home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 004 / rmbroom / !RMBroom / !Help next >
Text File  |  1994-09-17  |  5KB  |  147 lines

  1. RMBroom version 1.00 7 Apr 1994
  2. -------------------------------
  3.  
  4.  
  5.  
  6. Introduction
  7. ------------
  8.  
  9. RMBroom RMKills modules which are no longer used - i.e. when
  10. all the applications which were using a module are closed down.
  11.  
  12. RMBroom keeps a count of how many applications are using each module, and
  13. RMKill's any module whose count reaches zero.
  14.  
  15. Note that RMKill-ing a module will not always give you back the modules
  16. memory imediately because the RMA can get very fragmented.
  17.  
  18.  
  19.  
  20. How to use RMBroom
  21. ------------------
  22.  
  23. RMBroom has to be told which modules each application uses. You do this by
  24. setting a system variable for each appliction called 'RMBroom$<app name>'
  25. to contain a space-separated list of the modules which each application
  26. uses (The application will probably have RMEnsure/RMLoad commands in its
  27. !Run file for each of these modules).
  28.  
  29. <app name> should be the name which appears in the task-managers window
  30. (if this contains spaces, replace them with underscores '_'). 
  31.  
  32. The Obey file '!RMBroom.Apps' in RMBroom's application directory sets
  33. RMBroom$... variables for the applications which I use or have seen.
  34. Have a look to see how everything works. Simply add to this file to
  35. include the applications and their modules which are used on your
  36. machine. This file is run when RMBroom starts up. 
  37.  
  38. If you change !RmBroom.Apps while RMBroom is running, then
  39. just double-click on !RmBroom.Apps - there is no need to restart
  40. !RMBroom.
  41.  
  42. RMBroom doesn't have an iconbar icon - use the task-manager window to quit
  43. it. You can start RMBroom after other applications have started - it looks
  44. at all running tasks when it starts up.
  45.  
  46. Note that RMBroom will never RMKill modules which you haven't told it
  47. about.
  48.  
  49.  
  50.  
  51. Application close-down commands
  52. -------------------------------
  53.  
  54. In addition to RMKill-ing modules, you can make RMBroom execute a
  55. command when a task terminates. This is normally difficult to do in RISC
  56. OS because of a bug in the Obey module which prevents you from having
  57. any commands after the 'Run <foo$Dir>.!RunImage' in an applications !Run
  58. file. 
  59.  
  60. For example, I wanted to increase the font cache before my wordprocesor
  61. starts up (easy - just a line in its !Run file), then decrease it when
  62. it finished (not so easy - you can't put commands after the 'Run
  63. <Obey$Dir>.!RunImage'. 
  64.  
  65. The solution which !RMBroom provides is to append a hyphen '-' to the
  66. system variable 'RMBroom$<appname>' (after any module names), followed by a
  67. command. When the application quits, the text starting after the '-' is
  68. passed to the Command Line Interpreter (CLI). Thus, I have set the variable
  69. 'RMBroom$TechWriter' to be '-ChangeDynamicArea -FontSize 32k'. If you
  70. wanted to do more complicated things such as have multiple commands, you
  71. could use '-Filer_Run |<foo$Dir>.!Stop' which would run a file '!Stop'
  72. in an application's directory after the app finishes.
  73.  
  74.  
  75.  
  76. Warning
  77. -------
  78.  
  79. Note that RMKill-ing a module while an applcation which uses it is still
  80. running will probably cause the application to crash. This means that if
  81. you forget that (say) !Templed uses the 'MenuUtils' module, and so don't
  82. set 'RMBroom$TemplEd' to include 'MenuUtils', RMBroom could RMKill
  83. MenuUtils whilst TemplEd is still using it.
  84.  
  85. RMBroom queries you for each RMKill using a standard error box. You can
  86. make the RMKills automatic if you want - see the !Run file.
  87.  
  88.  
  89.  
  90.  
  91.  
  92. Vaguely technical stuff
  93. -----------------------
  94.  
  95. In an ideal world, the counting of users of modules would be done using
  96. an OS command, (e.g. like the registering of event handlers). The
  97. solution which RMBroom provides is a bit clunky, but the best I can
  98. think of. 
  99.  
  100. The main problem is that RMBroom takes up a 32k wimpslot on a 4MB machine.
  101. I would have written it as a module, but, while there is a
  102. Service_WimpCloseDown service call, there doesn't seem to be a service call
  103. which tells of an application starting up, so the program has to be a wimp
  104. task, and detect Wimp messages for task start/stop. There might be a way of
  105. making RMBroom a module by intercepting the Wimp_Initialise SWI, but this
  106. seemed a bit complicated to me!. Also, I was hoping to make RMBroom into a
  107. module-task, which would not use a full page of memory, but according to an
  108. Acorn technical note (from ftp.acorn.co.uk), this is not possible for a
  109. module written in C.
  110.  
  111.  
  112.  
  113.  
  114. Other stuff.
  115. ------------
  116.  
  117. !RMBroom is Freeware and copyright Julian Smith 1994
  118.  
  119. If anybody has a sprite of a broom, could you possibly send it to me to use
  120. as a sprite for the RMBroom application?
  121.  
  122. If you have any comments or suggestions on this program, I would be very
  123. glad to here them. Particulaly welcome would be ideas on how to make a C
  124. module detect tasks starting/stopping.
  125.  
  126.  
  127.  
  128.  
  129. - Julian Smith
  130.  
  131.  
  132. ------------------------
  133. julians@cogsci.ed.ac.uk
  134. ------------------------
  135.  
  136. or:
  137.  
  138. ------------------------
  139. Department of Psychology
  140. University of Edinburgh
  141. 7 George Square
  142. Edinburgh 
  143. EH8 9JZ
  144. UK
  145. ------------------------
  146.  
  147.